const web = require("../../module/web"), loger = require("../../module/loger");

module.exports.run = (yzm)=>{
	web.run((w)=>{
		let inp = w.window.document.getElementById("mVcodeIpt");
		if(inp) inp.value = yzm;
		w.window.$("#mVcodeIpt").blur();
		
		// inp = w.window.document.getElementById("mobileRegA");
		// if(inp) inp.click();
		if(!yzm) global.sdObj.end = -99;
	},(w)=>{
		let inp2 = w.window.document.getElementById("mVcodeIpt");
		if(inp2 && inp2.value == ""){
			return true;
		}
		let inp = w.window.document.getElementById("mobileRegA");
		if(inp) inp.click();
		else{
			let tip = w.window.document.getElementsByClassName("u-yx-yellow u-yx-fontSize22 u-uid-border");
			if(tip && tip[0] && tip[0].innerHTML.indexOf("注册成功") != -1){
				global.sdObj.end = 0;
				return true;					
			}
		}
	});
}